package com.fesine.quartz.util;

import java.util.Date;

/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/11/18 22:35
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/11/18 22:35
 */
public class DateUtil {
    public static Date buildHoliday(Date excludedDate) {
        java.util.Calendar cl = java.util.Calendar.getInstance();
        java.util.Calendar clEx = java.util.Calendar.getInstance();
        clEx.setTime(excludedDate);
        cl.setLenient(false);
        cl.clear();
        cl.set(clEx.get(1), clEx.get(2), clEx.get(5));
        return cl.getTime();
    }

    public static long buildHoliday(long timeStamp) {
        return buildHoliday(new Date(timeStamp)).getTime();
    }

    public static java.util.Calendar getJavaCalendar(long timeStamp) {
        java.util.Calendar cl = java.util.Calendar.getInstance();
        cl.setTime(new Date(timeStamp));
        return cl;
    }
}
